package com.jlpay.open.jlpay.sdk.java.model.openmerch.device;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 加机类型，机具类型
 *
 * @author dengwenning
 * @since 2024/4/24
**/
@Getter
@AllArgsConstructor
public enum DeviceEnum {

    /**
     *
     */
    TERM("term", "终端加机"),
    /**
     * 码付加机不需要设备机身号
     */
    QRCODE("qrcode", "码付加机"),
    ;

    @JsonValue
    private final String value;

    private final String description;

    @JsonCreator
    public static DeviceEnum getEnumByValue(String value) {
        for (DeviceEnum deviceEnum : values()) {
            if (value.equals(deviceEnum.getValue())) {
                return deviceEnum;
            }
        }
        return null;
    }
}
